﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="nav_list.aspx.cs" Inherits="YULI.Web.admin.settings.nav_list" %>

<%@ Import Namespace="YULI.Common" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>栏目</title>
    <link href="../css/shop.css" type="text/css" rel="stylesheet" />
    <link href="/css/Sellerber.css" type="text/css" rel="stylesheet" />
    <link href="../css/bkg_ui.css" type="text/css" rel="stylesheet" />
    <link href="../font/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <script src="/scripts/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/scripts/jquery/jquery.nestable.min.js"></script>
    <script src="/scripts/jquery/jquery.SuperSlide.2.1.1.js" type="text/javascript"></script>
    <script src="/scripts/jquery/jquery.dataTables.min.js"></script>
    <script src="/scripts/jquery/jquery.dataTables.bootstrap.js"></script>
    <script src="/scripts/layer/layer.js" type="text/javascript"></script>
    <script src="js/jquery.nicescroll.js" type="text/javascript"></script>
    <script src="../js/common/function.js" type="text/javascript"></script>
</head>
<body>
    <div class="margin" id="page_style">
        <div class="operation">
            <span class="submenu"><a href="nav_edit.aspx" class="btn button_btn bg-deep-blue" title="添加栏目" onclick="add_columns()"><i class="fa  fa-edit"></i>&nbsp;添加栏目</a></span>
        </div>
        <div class="Columns_list slideBox margin-top" id="Columns_list">
            <%--<div class="hd">
                <ul>
                    <li>主导航栏目</li>
                    <li>顶部栏目</li>
                    <li>底部栏目</li>
                </ul>
            </div>--%>
            <div class="bd">
                <ul class="main_column">
                    <table class="table table_list table_striped table-bordered  margin-top">
                        <thead>
                            <tr>
                                <th width="12%">栏目名称</th>
                                <th width="40%">链接地址</th>
                                <th width="10%">样式</th>
                                <th width="8%">默认</th>
                                <th width="5%">状态</th>
                                <th width="5%">排序</th>
                                <th width="20%">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td colspan="7" class="padding_none">
                                    <div class="dd" id="nestable">
                                        <ol class="dd-list">
                                            <%for (int i = 0; i < NavList(0).Rows.Count; i++)
                                                {%>
                                            <li class="dd-item" data-id="<%=NavList(0).Rows[i]["id"].ToString()%>">
                                                <div class="dd-handle">
                                                    <table>
                                                        <tbody>
                                                            <tr>
                                                                <td width="12%"><%=NavList(0).Rows[i]["title"].ToString()%></td>
                                                                <td width="40%"><%=NavList(0).Rows[i]["link_url"].ToString()%></td>
                                                                <td width="10%"><%=NavList(0).Rows[i]["icon_url"].ToString()%></td>
                                                                <td width="8%"><%=Convert.ToInt32(NavList(0).Rows[i]["is_sys"])==1?"√":"×"%></td>
                                                                <td width="5%"><%=Convert.ToInt32(NavList(0).Rows[i]["is_lock"])==0?"显示":"隐藏"%></td>
                                                                <td width="5%"><%=NavList(0).Rows[i]["sort_id"].ToString()%></td>
                                                                <td width="20%" class="operating">
                                                                    <a href="nav_edit.aspx?action=<%#YULIEnums.ActionEnum.Add%>&id=<%=NavList(0).Rows[i]["id"].ToString()%>" class="btn btn-white button_btn">添加子栏目</a>
                                                                    <a href="nav_edit.aspx?action=<%#YULIEnums.ActionEnum.Edit%>&id=<%=NavList(0).Rows[i]["id"].ToString()%>" class="btn btn-white button_btn">修改</a>
                                                                    <a href="javascrpit:void()" class="btn btn-white button_btn" onclick="columns_delete(this,'10')">删除</a>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                                <ol class="dd-list">
                                                    <%for (int j = 0; j < NavList(Convert.ToInt32(NavList(0).Rows[i]["id"])).Rows.Count; j++)
                                                        {%>
                                                    <li class="dd-item" data-id="<%=NavList(Convert.ToInt32(NavList(0).Rows[i]["id"])).Rows[i]["id"].ToString()%>">
                                                        <div class="dd-handle dd-handle_two">
                                                            <table>
                                                                <tbody>
                                                                    <tr>
                                                                        <td width="12%"><%=NavList(Convert.ToInt32(NavList(0).Rows[i]["id"])).Rows[i]["title"].ToString()%></td>
                                                                        <td width="40%"><%=NavList(Convert.ToInt32(NavList(0).Rows[i]["id"])).Rows[i]["link_url"].ToString()%></td>
                                                                        <td width="10%"><%=NavList(Convert.ToInt32(NavList(0).Rows[i]["id"])).Rows[i]["icon_url"].ToString()%></td>
                                                                        <td width="8%"><%=Convert.ToInt32(NavList(Convert.ToInt32(NavList(0).Rows[i]["id"])).Rows[i]["is_sys"])==1?"√":"×"%></td>
                                                                        <td width="5%"><%=Convert.ToInt32(NavList(Convert.ToInt32(NavList(0).Rows[i]["id"])).Rows[i]["is_lock"])==0?"显示":"隐藏"%></td>
                                                                        <td width="5%"><%=NavList(Convert.ToInt32(NavList(0).Rows[i]["id"])).Rows[i]["sort_id"].ToString()%></td>
                                                                        <td width="20%">
                                                                            <a href="nav_edit.aspx?action=<%#YULIEnums.ActionEnum.Add%>&id=<%=NavList(Convert.ToInt32(NavList(0).Rows[i]["id"])).Rows[i]["id"].ToString()%>" class="btn btn-danger button_btn">添加子栏目</a>
                                                                            <a href="nav_edit.aspx?action=<%#YULIEnums.ActionEnum.Edit%>&id=<%=NavList(Convert.ToInt32(NavList(0).Rows[i]["id"])).Rows[i]["id"].ToString()%>" class="btn btn-danger button_btn">修改</a>
                                                                            <a href="javascrpit:void()" class="btn btn-danger button_btn" onclick="columns_delete(this,'10')">删除</a>
                                                                        </td>
                                                                    </tr>
                                                                </tbody>
                                                            </table>
                                                        </div>
                                                    </li>
                                                    <%}%>
                                                </ol>
                                            </li>
                                            <%}%>
                                            <%if (NavList(0).Rows.Count <= 0) {%>
                                            <li class="dd-item" data-id="0">
                                                暂无数据...
                                            </li>
                                            <%}%>
                                        </ol>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </ul>
            </div>
        </div>
    </div>

</body>
</html>
<script type="text/javascript">

    jQuery(function ($) {
        $('.dd').nestable();
        $('.dd-handle a').on('mousedown', function (e) {
            e.stopPropagation();
        });
    });
    /**栏目删除**/
    function NavDelete(navId, isSys) {
        layer.confirm('确认要删除吗？', { icon: 0, }, function (index) {
            $(obj).parents("li").remove();
            layer.msg('已删除!', { icon: 1, time: 1000 });
        });
    }

    function add_columns() {
        layer.open({
            type: 1,
            title: '添加栏目',
            maxmin: false,
            shadeClose: false, //点击遮罩关闭层
            area: ['600px', '400px'],
            content: $('#add_columns_style'),
            btn: ['提交', '取消'],
        });


    }
    jQuery(".slideBox").slide({ trigger: "click", easing: "easeOutElastic" });

    /*******滚动条*******/
    $("body").niceScroll({
        cursorcolor: "#888888",
        cursoropacitymax: 1,
        touchbehavior: false,
        cursorwidth: "5px",
        cursorborder: "0",
        cursorborderradius: "5px"
    });
</script>

